package com.zl.service.impl;

import com.zl.dao.BankDao;
import com.zl.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author ljm
 * @Date 2021/11/26 15:58
 */
@Service
public class BankServiceImpl implements BankService {
    @Autowired
    private BankDao bd;

    /*@Override
    @Transactional
    public int quqian() {
        int flag = bd.quqian();
        return flag;
    }

    @Override
    @Transactional
    public int cunqian() {
        int flag=bd.cunqian();
        return flag;
    }*/

    @Override
    /*@Transactional(propagation = Propagation.REQUIRES_NEW,
            isolation = Isolation.SERIALIZABLE,
            rollbackFor = Throwable.class,timeout = 1000
    )*/
    //norollbackFor = Throwable.class 遇到异常不回滚
    public int zz() {
        bd.quqian();
        bd.cunqian();
        int i = 0;
        System.out.println(10/i);
        return i;
    }
}
